

var app = getApp()
Page({
  data: {

  },
  onLoad: function (options) {

  },

  test(){
    let data = {
      orderId:8
    }
    app.request('wx_app/agent_order/payment',data,'GET').then(res=>{
      console.log(res)
      if (res.code==1) {   
        let date = Date.parse(new Date())   
        wx.requestPayment({
          timeStamp: res.data.timeStamp,
          nonceStr: res.data.nonceStr,
          package: res.data.package,
          signType: 'MD5',
          paySign: res.data.sign,
          success(res){
            console.log(res)
          },
          fail(res){
            console.log(res)
          },
          complete(res){
            console.log(res)
          }
        })
      }else{
        app.errorMsg(res.message)
      }
    })
  }



})